package com.cn.goodsadmin.po;

import com.cn.goodsadmin.util.TimeUtil;

import javax.persistence.*;
import java.util.Date;
import java.util.List;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * @author fly
 * @create 2017-11-28 15:40
 **/

@Entity
@Table(name = "t_words", schema = "c_goods", catalog = "")
public class Words {
    private int cId;
    private String cMsgId;
    private String cContent;
    private String cMsgtype;
    private String cTousername;
    private String cFromusername;
    private String cCtime;
    private Date   cGctime= TimeUtil.getCurrTimeHm();
    public  List<Words> callBackList;
    public  boolean  iscallBack=false;
    public  String   userName;

    @Basic
    @Column(name = "c_gctime", nullable = false)
    public Date getcGctime() {
        return cGctime;
    }

    public void setcGctime(Date cGctime) {
        this.cGctime = cGctime;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "c_id", nullable = false)
    public int getcId() {
        return cId;
    }

    public void setcId(int cId) {
        this.cId = cId;
    }

    @Basic
    @Column(name = "c_msgId", nullable = false, length = 30)
    public String getcMsgId() {
        return cMsgId;
    }

    public void setcMsgId(String cMsgId) {
        this.cMsgId = cMsgId;
    }

    @Basic
    @Column(name = "c_content", nullable = false, length = 200)
    public String getcContent() {
        return cContent;
    }

    public void setcContent(String cContent) {
        this.cContent = cContent;
    }

    @Basic
    @Column(name = "c_msgtype", nullable = false, length = 10)
    public String getcMsgtype() {
        return cMsgtype;
    }

    public void setcMsgtype(String cMsgtype) {
        this.cMsgtype = cMsgtype;
    }

    @Basic
    @Column(name = "c_tousername", nullable = false, length = 100)
    public String getcTousername() {
        return cTousername;
    }

    public void setcTousername(String cTousername) {
        this.cTousername = cTousername;
    }

    @Basic
    @Column(name = "c_fromusername", nullable = false, length = 100)
    public String getcFromusername() {
        return cFromusername;
    }

    public void setcFromusername(String cFromusername) {
        this.cFromusername = cFromusername;
    }

    @Basic
    @Column(name = "c_ctime", nullable = true, length = 10)
    public String getcCtime() {
        return cCtime;
    }

    public void setcCtime(String cCtime) {
        this.cCtime = cCtime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Words words = (Words) o;

        if (cId != words.cId) return false;
        if (cMsgId != null ? !cMsgId.equals(words.cMsgId) : words.cMsgId != null) return false;
        if (cContent != null ? !cContent.equals(words.cContent) : words.cContent != null) return false;
        if (cMsgtype != null ? !cMsgtype.equals(words.cMsgtype) : words.cMsgtype != null) return false;
        if (cTousername != null ? !cTousername.equals(words.cTousername) : words.cTousername != null) return false;
        if (cFromusername != null ? !cFromusername.equals(words.cFromusername) : words.cFromusername != null)
            return false;
        if (cCtime != null ? !cCtime.equals(words.cCtime) : words.cCtime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = cId;
        result = 31 * result + (cMsgId != null ? cMsgId.hashCode() : 0);
        result = 31 * result + (cContent != null ? cContent.hashCode() : 0);
        result = 31 * result + (cMsgtype != null ? cMsgtype.hashCode() : 0);
        result = 31 * result + (cTousername != null ? cTousername.hashCode() : 0);
        result = 31 * result + (cFromusername != null ? cFromusername.hashCode() : 0);
        result = 31 * result + (cCtime != null ? cCtime.hashCode() : 0);
        return result;
    }
}
